import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import json from '@rollup/plugin-json'; // 导入 JSON 插件

export default {
    input: './src/app.js',
    output: {
        file: 'dist/bundle.js',
        format: 'cjs',
    },
    plugins: [
        resolve({
            preferBuiltins: true
        }),
        commonjs(),
        json() // 使用 JSON 插件
    ],
    external: ['mongoose', 'koa', 'koa-router'],
};